#!/bin/bash
RA=30 
DEC=40
TempUSNORADEC=TempUSNORADEC.txt
dir_usnob10=$HOME/usnob10
dir_reduction=`pwd`
Dir_now=`pwd`
xGetCatalog (  )
{
   echo "xGetCatalog"
    cd $dir_reduction
#    echo "~/usnob10/src/usnob1 -R $dir_usnob10 -c $RA $DEC  -r 25 -lmr2 0,23 -m 2000000 -sr >listusnobobj"
    ~/usnob10/src/usnob1 -R $dir_usnob10 -c $RA, $DEC  -r 25 -lmr2 0,23 -m 2000000 -sr >listusnobobj
    head -1 listusnobobj

    python $dir_usnob10/xusnob10_format.py ./ listusnobobj
    mv tmp_listusnobobj $TempUSNORADEC
    #output includes ra dec b1 b2 R1 R2 I

#    ~/usnob1/usnob1 -m 2000000  -r 0.3 -c $RA $DEC -lmr -6,20 -sr > $TempUSNORADEC
    if test -s $TempUSNORADEC
    then
        echo "Geting catalog is successful"
    else
        echo "Geting catalog failed"
        echo $Dir_now
        exit 0
    fi
}

xGetCatalog
